#ifndef __HMC5883L_STM32F4XX_HAL_H
#define __HMC5883L_STM32F4XX_HAL_H

#include "stdint.h"

/* */
#define HMC5883L_ADDRESS 0x1E
/* registers of hmc5883l */
#define HMC5883L_CONFIGURATION_REGISTERA 0x00
#define HMC5883L_CONFIGURATION_REGISTERB 0x01
#define HMC5883L_MODE_REGISTER 0x02
#define HMC5883L_DATAX_MSB 0x03
#define HMC5883L_DATAX_LSB 0x04
#define HMC5883L_DATAY_MSB 0x05
#define HMC5883L_DATAY_LSB 0x06
#define HMC5883L_DATAZ_MSB 0x07
#define HMC5883L_DATAZ_LSB 0x08
/* measurement mode */
#define MEASUREMENT_CONTINUOUS 0x00
#define MEASUREMENT_SINGLE_SHOT 0x01
#define MEASUREMENT_IDLE 0x03

#define HMC5883L_FIFO_NUM 5

typedef struct
{
	int32_t gx;
	int32_t gy;
	int32_t gz;
}HMC5883L_DateType;

void HAL_HMC5883L_Init(void);
HMC5883L_DateType HAL_HMC5883L_GetRawData(void);
uint16_t HAL_HMC5883L_GetYaw(void);
uint16_t HAL_HMC5883L_GetYawSafe(void);
#endif
